package com.framework.rocketmq.component.rocketmq;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 消息生产者
 */
@Component
public class RocketMQProducer {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    // 发送消息
    public void sendMessage(String messageContent) {
        rocketMQTemplate.convertAndSend("topic-test", messageContent);
    }

}
